package org.sky.generator.database.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.sky.util.CamelUtils;

import java.util.List;

/**
 * @author weifx
 * @Title: Table
 * @ProjectName springboot-platform
 * @Description: TODO{数据表模型}
 * @date 2019/2/25 23:33
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain=true)
public class Table {
    /**
     * 表名
     */
    private String tableName;
    /**
     * 表注释
     */
    private String tableComment;
    /**
     * 数据库列
     */
    private List<Column> columnList;

    /**
     * 获取实体名
     * @return
     */
    public String getEntityName(){
        return CamelUtils.toUpperCaseFirstChar(CamelUtils.underlineToCamel(tableName));
    }
}
